﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B303Langf.Parser.AST
{
   public class Declarations : AST
   {
      public Declarations()
      {
         List = new List<Declaration>();
      }

      public List<Declaration> List
      {
         get;
         private set;
      }

      public override object Visit( IVisitor v, object obj )
      {
         return v.VisitDeclarations( this, obj );
      }

      public int CalculateSize()
      {
         return List.Sum( x => x.Type.Size );
      }
   }
}
